import React, { Component } from 'react';
import NavHead from '../components/NavHead'
import { ShowBox } from './showSttyled'
import { withRouter } from 'react-router-dom'
import Listshow from './Listshow'
import { get } from '@u/http.js'

@withRouter
class showCourse extends Component {
    state={
        list:[]
    }

    async componentDidMount(){
       let result =await get({
           url:'/api/keJIan/danYuan/?bookId=1 '
       })

       this.setState({
           list:result.data.danYuan
       })
    }

    render() {
        let {state} = this.props.location
        return (
            <ShowBox>
                <NavHead title={state }></NavHead>
                <Listshow list={ this.state.list }></Listshow>
            </ShowBox>
        );
    }
}

export default showCourse;